/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package banksystem;

/**
 *
 * @author ROBM
 */
public class CustomerRelationsFrame extends javax.swing.JFrame {

	Controller mController;
	/**
	 * Creates new form CustomerRelationsFrame
	 */
	public CustomerRelationsFrame(Controller controller) {
		mController = controller;
		initComponents();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        openAccountButton = new javax.swing.JButton();
        closeAccountButton = new javax.swing.JButton();
        accountInfoButton = new javax.swing.JButton();
        backButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        openAccountButton.setText("Open Account");
        openAccountButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                openAccountButtonMouseClicked(evt);
            }
        });

        closeAccountButton.setText("Close Account");
        closeAccountButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                closeAccountButtonMouseClicked(evt);
            }
        });

        accountInfoButton.setText("Account Info");
        accountInfoButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                accountInfoButtonMouseClicked(evt);
            }
        });
        accountInfoButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                accountInfoButtonActionPerformed(evt);
            }
        });

        backButton.setText("Back");
        backButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                backButtonMouseClicked(evt);
            }
        });

        jLabel1.setText("Customer Information");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(136, 136, 136)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(closeAccountButton)
                    .addComponent(openAccountButton)
                    .addComponent(accountInfoButton)
                    .addComponent(jLabel1)
                    .addComponent(backButton))
                .addContainerGap(139, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(28, 28, 28)
                .addComponent(openAccountButton)
                .addGap(18, 18, 18)
                .addComponent(closeAccountButton)
                .addGap(18, 18, 18)
                .addComponent(accountInfoButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
                .addComponent(backButton)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void openAccountButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openAccountButtonMouseClicked
		this.mController.SelectOpenBankAccount();
	}//GEN-LAST:event_openAccountButtonMouseClicked

	private void closeAccountButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeAccountButtonMouseClicked
		mController.SelectCloseBankAccount();
	}//GEN-LAST:event_closeAccountButtonMouseClicked

	private void accountInfoButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_accountInfoButtonMouseClicked
		// TODO add your handling code here:
	}//GEN-LAST:event_accountInfoButtonMouseClicked

	private void backButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_backButtonMouseClicked
		this.mController.SaveAndRestart(this);
	}//GEN-LAST:event_backButtonMouseClicked

	private void accountInfoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_accountInfoButtonActionPerformed
		mController.GoToUserInfo();
	}//GEN-LAST:event_accountInfoButtonActionPerformed

	
	
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton accountInfoButton;
    private javax.swing.JButton backButton;
    private javax.swing.JButton closeAccountButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton openAccountButton;
    // End of variables declaration//GEN-END:variables
}
